﻿<div>
    <div class="page-title" ng-init="subscription.initData()">
        Add/Edit Alert
    </div>

    <div id="container">
        <div class="numbered-title ng-scope">
            Select the portfolio to include in your Alerts to receive <b>bi-weekly</b> email updates regarding changes in Controversy Assessment and Outlook.
            
        </div>
        <br />
        <div class="numbered-title ng-scope">
            <div class="numbered-title-text floatLeft" style="width: 80%;">
                <div class="title-16-bold">
                    Available Portfolios:
                </div>
                <div style="float: left; width: 100%;">
                    <!--<div ng-disabled="!subscription.hasEditPermission" ng-class="!subscription.hasEditPermission ? 'disabled_ms' : ''" ng-dropdown-multiselect
                             options="subscription.allPortfolios" selected-model="subscription.selectedPortfolios"
                             extra-settings="subscription.portfolioGroupingSettings" group-by="group" events="subscription.myEvents">
                    </div>-->
                    <multi-select-tree data-input-model="subscription.allPortfolios" multi-select="true"
                                       data-output-model="subscription.selectedPortfolios"
                                       data-default-label="Click here to select..." data-select-only-leafs="true">
                    </multi-select-tree>
                </div>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>

        <div ng-show="subscription.sharedPortfolios && subscription.item.enabled">
            Companies in portfolios that you did not create, will be removed from the email alert when the owner deletes or stops sharing the item.
        </div>
        <br />

        <div ng-init="selected" ng-switch on="subscription.item.enabled" style="display: none;">
            <button ng-switch-when='true' ng-click='subscription.disabledSubscription()' class="switch-btn_on">Enabled</button>
            <button ng-switch-when='false' ng-click='subscription.enabledSubscription()' class="switch-btn">Disabled</button>
        </div>

        <button class="btn-green" ng-disabled="!(subscription.selectedPortfolios.length && subscription.item.frequency != null)" ng-click="subscription.addEditAlert()">Save</button>
        <button class="btn-green" ng-click="subscription.cancel()">Cancel</button>
        <div class="clear">&nbsp;</div><br />
    </div>
</div>